package
{
	import starling.display.Image;
	import starling.textures.Texture;
	
	public class TileImage extends Image
	{
		private var _worldX:Number;
		private var _worldY:Number;
		private var _width:Number;
		private var _height:Number;
		
		public function TileImage(texture:Texture)
		{
			super(texture);
			_width = this.width;
			_height = this.height;
		}

		public function get wy():Number
		{
			return _worldY;
		}

		public function set wy(value:Number):void
		{
			_worldY = value;
		}

		public function get wx():Number
		{
			return _worldX;
		}

		public function set wx(value:Number):void
		{
			_worldX = value;
		}

		public function intersectsLine(x1:Number, x2:Number):Boolean
		{
			var objX1:Number = x;
			var objX2:Number = objX1 + _width - 1;
			return (objX1 > x1 || objX2 > x1);	/**Collision test for objects to the right are turned off for now because 4 columns 
			 									 * to the right of camera that are not in view are cached in advance for continuity
												**/ //&& (objX1 < x2 || objX2 < x2); 
		}
	}
}